package org.come.mouslisten;

import org.come.Jpanel.PetSkillsJpanel;

import java.math.BigDecimal;
import java.util.Map;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

import org.come.bean.ConfigureBean;
import org.come.bean.Skill;
import org.come.model.Configure;
import org.come.until.UserMessUntil;
import org.come.Frame.PetSkillsJframe;

public class ChosePetSkillsMouslisten {
    private static int skllNum = 9;
    public static void refreshPetSkills() {
        ConfigureBean allConfigure = UserMessUntil.getConfigureBean();
        Map<BigDecimal, Configure> item = allConfigure.getAllConfigure();
        Configure configure = item.get(new BigDecimal(1));
        Configure configure7 = item.get(new BigDecimal(7));


        if("新".equals(configure7.getZhsjngs())) {

            if(configure.getZhsjngs()!=null) {
                skllNum = Integer.parseInt(configure.getZhsjngs());
            }
            final PetSkillsJpanel petSkillsJpanel = PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel();
            int Skillwl1 = 0;



            if (UserMessUntil.getChosePetMes() != null && UserMessUntil.getChosePetMes().getPetSkills() != null && !"".equals(UserMessUntil.getChosePetMes().getPetSkills())) {
                final String[] petnaturalskill = UserMessUntil.getChosePetMes().getPetSkills().split("\\|");
                for (int i = 0; i < skllNum-1; ++i) {
                    petSkillsJpanel.getLabPetskills()[i].setIcon(null);
                    petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
                }
                for (int i = 0; i < petnaturalskill.length; ++i) {
                    final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
                    final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
                    img.setImage(img.getImage().getScaledInstance(50, 50, 10));
                    petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)img);
                    petSkillsJpanel.getShowPetSkills()[i].setSkill(skill);
                    if (UserMessUntil.getChosePetMes().getPetSkillswl() != null && !"".equals(UserMessUntil.getChosePetMes().getPetSkillswl())) {
                        final String[] petskillswl = UserMessUntil.getChosePetMes().getPetSkillswl().split("\\|");
                        for (int i2 = 0; i2 < petskillswl.length; ++i2) {
                            final String[] level = petskillswl[i2].split("=");
                            if (petnaturalskill[i].equals(level[0])) {
                                Skillwl1 = Integer.parseInt(level[1]);
                            }
                        }
                    }
                    petSkillsJpanel.getShowPetSkills()[i].setSkillwl(Skillwl1);
                    if (Skillwl1 == 0) {
                        petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)img);
                    }
                    else {
                        final ImageIcon img2 = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + "x.png");
                        img2.setImage(img2.getImage().getScaledInstance(52, 52, 10));
                        petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)img2);
                    }
                    petSkillsJpanel.getShowPetSkills()[i].setSkill(skill);
                    Skillwl1 = 0;
                }
                if (UserMessUntil.getChosePetMes().getOpenSeal().intValue() <= skllNum-2) {
                    for (int i = UserMessUntil.getChosePetMes().getOpenSeal().intValue(); i < skllNum-1; ++i) {
                        petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
                        petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
                    }
                }



            } else {


                for (int i = 0; i < skllNum-1; ++i) {
                    petSkillsJpanel.getLabPetskills()[i].setIcon(null);
                    petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
                }
                if (UserMessUntil.getChosePetMes().getOpenSeal().intValue() <= skllNum-2) {
                    for (int i = UserMessUntil.getChosePetMes().getOpenSeal().intValue(); i < skllNum-1; ++i) {
                        petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
                        petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
                    }
                }
            }




            if (UserMessUntil.getChosePetMes() != null && UserMessUntil.getChosePetMes().getPetQlSkills() != null && !"".equals(UserMessUntil.getChosePetMes().getPetQlSkills())) {
                if(skllNum == 9){
                    final String[] petnaturalskill = UserMessUntil.getChosePetMes().getPetQlSkills().split("\\|");
                    for (int i = 0; i < 6; ++i) {
                        petSkillsJpanel.getQlPetskills()[i].setIcon(null);
                        petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
                    }
                    for (int i = 0; i < petnaturalskill.length; ++i) {
                        final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
                        final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
                        img.setImage(img.getImage().getScaledInstance(50, 50, 10));
                        petSkillsJpanel.getQlPetskills()[i].setIcon((Icon)img);
                        petSkillsJpanel.getShowQlPetSkills()[i].setSkill(skill);
                    }
                    if (UserMessUntil.getChosePetMes().getOpenql().intValue() <= 5) {
                        for (int i = UserMessUntil.getChosePetMes().getOpenql().intValue(); i < 6; ++i) {
                            petSkillsJpanel.getQlPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
                            petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
                        }
                    }
                }


            } else {


                if(skllNum == 9){
                    for (int i = 0; i < 6; ++i) {
                        petSkillsJpanel.getQlPetskills()[i].setIcon(null);
                        petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
                    }
                    if (UserMessUntil.getChosePetMes().getOpenql().intValue() <= 6) {
                        for (int i = UserMessUntil.getChosePetMes().getOpenql().intValue(); i < 6; ++i) {
                            petSkillsJpanel.getQlPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
                            petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
                        }
                    }
                }
            }



            if (UserMessUntil.getChosePetMes().getBeastSkills() != null && !"".equals(UserMessUntil.getChosePetMes().getBeastSkills())) {
                petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon(null);
                petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(null);
                final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(UserMessUntil.getChosePetMes().getBeastSkills());
                final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + UserMessUntil.getChosePetMes().getBeastSkills() + ".png");
                img.setImage(img.getImage().getScaledInstance(50, 50, 10));
                petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon((Icon)img);
                petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(skill);


            } else {


                petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon(null);
                petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(null);
                if (UserMessUntil.getChosePetMes().getOpenSeal().intValue() < skllNum) {
                    petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
                    petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(null);
                }
            }



            PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getModelNaturalskill().removeAllElements();
//            if(petSkillsJpanel.skllNum == 7) {
//                for (int i = 0; i < 5; ++i) {
//                    petSkillsJpanel.getLabPetskillsTS()[i].setIcon(null);
//                    petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(null);
//                }
//            }
//
//            if(petSkillsJpanel.skllNum == 5) {
//                for (int i = 0; i < 5; ++i) {
//                    petSkillsJpanel.getLabPetskillsTS()[i].setIcon(null);
//                    petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(null);
//                }
//            }
//            if(petSkillsJpanel.skllNum == 9) {
//                for (int i = 0; i < 5; ++i) {
//                    petSkillsJpanel.getLabPetskillsTS()[i].setIcon(null);
//                    petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(null);
//                }
//            }
//
//
//
//
//            if (UserMessUntil.getChosePetMes().getSkill() != null && !"".equals(UserMessUntil.getChosePetMes().getSkill())) {
//                final String[] petnaturalskill = UserMessUntil.getChosePetMes().getSkill().split("\\|");
//
//
//                for (int i = 0; i < petnaturalskill.length; ++i) {
//                    if(petSkillsJpanel.skllNum == 7) {
//                        final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                        final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
//                        img.setImage(img.getImage().getScaledInstance(50, 50, 10));
//                        petSkillsJpanel.getLabPetskillsTS()[i].setIcon((Icon)img);
//                        petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(skill);
//                    }else {
//                        final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                        PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getModelNaturalskill().add(i, skill.getSkillname());
//                    }
//
//
//                }
//
//                for (int i = 0; i < petnaturalskill.length; ++i) {
//                    if(petSkillsJpanel.skllNum == 5) {
//                        final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                        final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
//                        img.setImage(img.getImage().getScaledInstance(50, 50, 10));
//                        petSkillsJpanel.getLabPetskillsTS()[i].setIcon((Icon)img);
//                        petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(skill);
//                    }else {
//                        final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                        PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getModelNaturalskill().add(i, skill.getSkillname());
//                    }
//
//
//                }
//
//
//                for (int i = 0; i < petnaturalskill.length; ++i) {
//                    if(petSkillsJpanel.skllNum == 9) {
//                        final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                        final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
//                        img.setImage(img.getImage().getScaledInstance(50, 50, 10));
//                        petSkillsJpanel.getLabPetskillsTS()[i].setIcon((Icon)img);
//                        petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(skill);
//                    }else {
//                        final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                        PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getModelNaturalskill().add(i, skill.getSkillname());
//                    }
//
//
//                }
//
//
//            }

            PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().addNaturalSkills(UserMessUntil.getChosePetMes());
        }else {//旧版排版界面
            if(configure.getZhsjngs()!=null) {
                skllNum = Integer.parseInt(configure.getZhsjngs());
            }
            final PetSkillsJpanel petSkillsJpanel = PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel();
            int Skillwl1 = 0;
            if (UserMessUntil.getChosePetMes() != null && UserMessUntil.getChosePetMes().getPetSkills() != null && !"".equals(UserMessUntil.getChosePetMes().getPetSkills())) {
                final String[] petnaturalskill = UserMessUntil.getChosePetMes().getPetSkills().split("\\|");
                for (int i = 0; i < skllNum-1; ++i) {
                    petSkillsJpanel.getLabPetskills()[i].setIcon(null);
                    petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
                }
                for (int i = 0; i < petnaturalskill.length; ++i) {
                    final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
                    final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
                    img.setImage(img.getImage().getScaledInstance(50, 50, 10));
                    petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)img);
                    petSkillsJpanel.getShowPetSkills()[i].setSkill(skill);
                    if (UserMessUntil.getChosePetMes().getPetSkillswl() != null && !"".equals(UserMessUntil.getChosePetMes().getPetSkillswl())) {
                        final String[] petskillswl = UserMessUntil.getChosePetMes().getPetSkillswl().split("\\|");
                        for (int i2 = 0; i2 < petskillswl.length; ++i2) {
                            final String[] level = petskillswl[i2].split("=");
                            if (petnaturalskill[i].equals(level[0])) {
                                Skillwl1 = Integer.parseInt(level[1]);
                            }
                        }
                    }
                    petSkillsJpanel.getShowPetSkills()[i].setSkillwl(Skillwl1);
                    if (Skillwl1 == 0) {
                        petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)img);
                    }
                    else {
                        final ImageIcon img2 = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + "x.png");
                        img2.setImage(img2.getImage().getScaledInstance(52, 52, 10));
                        petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)img2);
                    }
                    petSkillsJpanel.getShowPetSkills()[i].setSkill(skill);
                    Skillwl1 = 0;
                }
                if (UserMessUntil.getChosePetMes().getOpenSeal().intValue() <= skllNum-2) {
                    for (int i = UserMessUntil.getChosePetMes().getOpenSeal().intValue(); i < skllNum-1; ++i) {
                        petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
                        petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
                    }
                }
            }
            else {
                for (int i = 0; i < skllNum-1; ++i) {
                    petSkillsJpanel.getLabPetskills()[i].setIcon(null);
                    petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
                }
                if (UserMessUntil.getChosePetMes().getOpenSeal().intValue() <= skllNum-2) {
                    for (int i = UserMessUntil.getChosePetMes().getOpenSeal().intValue(); i < skllNum-1; ++i) {
                        petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
                        petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
                    }
                }
            }
            if (UserMessUntil.getChosePetMes() != null && UserMessUntil.getChosePetMes().getPetQlSkills() != null && !"".equals(UserMessUntil.getChosePetMes().getPetQlSkills())) {
                if(skllNum == 9){
                    final String[] petnaturalskill = UserMessUntil.getChosePetMes().getPetQlSkills().split("\\|");
                    for (int i = 0; i < 6; ++i) {
                        petSkillsJpanel.getQlPetskills()[i].setIcon(null);
                        petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
                    }
                    for (int i = 0; i < petnaturalskill.length; ++i) {
                        final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
                        final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
                        img.setImage(img.getImage().getScaledInstance(50, 50, 10));
                        petSkillsJpanel.getQlPetskills()[i].setIcon((Icon)img);
                        petSkillsJpanel.getShowQlPetSkills()[i].setSkill(skill);
                    }
                    if (UserMessUntil.getChosePetMes().getOpenql().intValue() <= 5) {
                        for (int i = UserMessUntil.getChosePetMes().getOpenql().intValue(); i < 6; ++i) {
                            petSkillsJpanel.getQlPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
                            petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
                        }
                    }
                }
            } else {
                if(skllNum == 9){
                    for (int i = 0; i < 6; ++i) {
                        petSkillsJpanel.getQlPetskills()[i].setIcon(null);
                        petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
                    }
                    if (UserMessUntil.getChosePetMes().getOpenql().intValue() <= 6) {
                        for (int i = UserMessUntil.getChosePetMes().getOpenql().intValue(); i < 6; ++i) {
                            petSkillsJpanel.getQlPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
                            petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
                        }
                    }
                }
            }
            if (UserMessUntil.getChosePetMes().getBeastSkills() != null && !"".equals(UserMessUntil.getChosePetMes().getBeastSkills())) {
                petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon(null);
                petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(null);
                final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(UserMessUntil.getChosePetMes().getBeastSkills());
                final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + UserMessUntil.getChosePetMes().getBeastSkills() + ".png");
                img.setImage(img.getImage().getScaledInstance(50, 50, 10));
                petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon((Icon)img);
                petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(skill);
            }
            else {
                petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon(null);
                petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(null);
                if (UserMessUntil.getChosePetMes().getOpenSeal().intValue() < skllNum) {
                    petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
                    petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(null);
                }
            }
            PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getModelNaturalskill().removeAllElements();
//            if(petSkillsJpanel.skllNum == 7) {
//                for (int i = 0; i < 5; ++i) {
//                    petSkillsJpanel.getLabPetskillsTS()[i].setIcon(null);
//                    petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(null);
//                }
//            }
//            if (UserMessUntil.getChosePetMes().getSkill() != null && !"".equals(UserMessUntil.getChosePetMes().getSkill())) {
//                final String[] petnaturalskill = UserMessUntil.getChosePetMes().getSkill().split("\\|");
//
//
//                for (int i = 0; i < petnaturalskill.length; ++i) {
//                    if(petSkillsJpanel.skllNum == 7) {
//                        final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                        final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
//                        img.setImage(img.getImage().getScaledInstance(50, 50, 10));
//                        petSkillsJpanel.getLabPetskillsTS()[i].setIcon((Icon)img);
//                        petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(skill);
//                    }else {
//                        final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                        PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getModelNaturalskill().add(i, skill.getSkillname());
//                    }
//
//
//                }

//            }
            PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().addNaturalSkills(UserMessUntil.getChosePetMes());
        }


//    	if(configure.getZhsjngs()!=null) {
//    		skllNum = Integer.parseInt(configure.getZhsjngs());
//    	}
//        final PetSkillsJpanel petSkillsJpanel = PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel();
//        int Skillwl1 = 0;
//
//
//
//        if (UserMessUntil.getChosePetMes() != null && UserMessUntil.getChosePetMes().getPetSkills() != null && !UserMessUntil.getChosePetMes().getPetSkills().equals("")) {
//            final String[] petnaturalskill = UserMessUntil.getChosePetMes().getPetSkills().split("\\|");
//            for (int i = 0; i < skllNum-1; ++i) {
//                petSkillsJpanel.getLabPetskills()[i].setIcon(null);
//                petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
//            }
//            for (int i = 0; i < petnaturalskill.length; ++i) {
//                final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
//                img.setImage(img.getImage().getScaledInstance(50, 50, 10));
//                petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)img);
//                petSkillsJpanel.getShowPetSkills()[i].setSkill(skill);
//                if (UserMessUntil.getChosePetMes().getPetSkillswl() != null && !UserMessUntil.getChosePetMes().getPetSkillswl().equals("")) {
//                    final String[] petskillswl = UserMessUntil.getChosePetMes().getPetSkillswl().split("\\|");
//                    for (int i2 = 0; i2 < petskillswl.length; ++i2) {
//                        final String[] level = petskillswl[i2].split("=");
//                        if (petnaturalskill[i].equals(level[0])) {
//                            Skillwl1 = Integer.parseInt(level[1]);
//                        }
//                    }
//                }
//                petSkillsJpanel.getShowPetSkills()[i].setSkillwl(Skillwl1);
//                if (Skillwl1 == 0) {
//                    petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)img);
//                }
//                else {
//                    final ImageIcon img2 = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + "x.png");
//                    img2.setImage(img2.getImage().getScaledInstance(52, 52, 10));
//                    petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)img2);
//                }
//                petSkillsJpanel.getShowPetSkills()[i].setSkill(skill);
//                Skillwl1 = 0;
//            }
//            if (UserMessUntil.getChosePetMes().getOpenSeal().intValue() <= skllNum-2) {
//                for (int i = UserMessUntil.getChosePetMes().getOpenSeal().intValue(); i < skllNum-1; ++i) {
//                    petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
//                    petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
//                }
//            }
//
//
//
//        } else {
//
//
//            for (int i = 0; i < skllNum-1; ++i) {
//                petSkillsJpanel.getLabPetskills()[i].setIcon(null);
//                petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
//            }
//            if (UserMessUntil.getChosePetMes().getOpenSeal().intValue() <= skllNum-2) {
//                for (int i = UserMessUntil.getChosePetMes().getOpenSeal().intValue(); i < skllNum-1; ++i) {
//                    petSkillsJpanel.getLabPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
//                    petSkillsJpanel.getShowPetSkills()[i].setSkill(null);
//                }
//            }
//        }
//
//
//
//
//        if (UserMessUntil.getChosePetMes() != null && UserMessUntil.getChosePetMes().getPetQlSkills() != null && !UserMessUntil.getChosePetMes().getPetQlSkills().equals("")) {
//        	if(skllNum == 9){
//        		final String[] petnaturalskill = UserMessUntil.getChosePetMes().getPetQlSkills().split("\\|");
//        		for (int i = 0; i < 6; ++i) {
//        			petSkillsJpanel.getQlPetskills()[i].setIcon(null);
//        			petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
//        		}
//        		for (int i = 0; i < petnaturalskill.length; ++i) {
//        			final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//        			final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
//        			img.setImage(img.getImage().getScaledInstance(50, 50, 10));
//        			petSkillsJpanel.getQlPetskills()[i].setIcon((Icon)img);
//        			petSkillsJpanel.getShowQlPetSkills()[i].setSkill(skill);
//        		}
//        		if (UserMessUntil.getChosePetMes().getOpenql().intValue() <= 5) {
//        			for (int i = UserMessUntil.getChosePetMes().getOpenql().intValue(); i < 6; ++i) {
//        				petSkillsJpanel.getQlPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
//        				petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
//        			}
//        		}
//        	}
//
//
//        } else {
//
//
//        	if(skllNum == 9){
//	            for (int i = 0; i < 6; ++i) {
//	            	petSkillsJpanel.getQlPetskills()[i].setIcon(null);
//	                petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
//	            }
//	            if (UserMessUntil.getChosePetMes().getOpenql().intValue() <= 6) {
//	                for (int i = UserMessUntil.getChosePetMes().getOpenql().intValue(); i < 6; ++i) {
//	                    petSkillsJpanel.getQlPetskills()[i].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
//	                    petSkillsJpanel.getShowQlPetSkills()[i].setSkill(null);
//	                }
//	            }
//        	}
//        }
//
//
//
//        if (UserMessUntil.getChosePetMes().getBeastSkills() != null && !UserMessUntil.getChosePetMes().getBeastSkills().equals("")) {
//            petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon(null);
//            petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(null);
//            final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(UserMessUntil.getChosePetMes().getBeastSkills());
//            final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + UserMessUntil.getChosePetMes().getBeastSkills() + ".png");
//            img.setImage(img.getImage().getScaledInstance(50, 50, 10));
//            petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon((Icon)img);
//            petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(skill);
//
//
//        } else {
//
//
//            petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon(null);
//            petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(null);
//            if (UserMessUntil.getChosePetMes().getOpenSeal().intValue() < skllNum) {
//                petSkillsJpanel.getLabPetskills()[skllNum-1].setIcon((Icon)new ImageIcon("inkImg/hongmu/2/111_png.xy2uiimg.wxs_fy.png"));
//                petSkillsJpanel.getShowPetSkills()[skllNum-1].setSkill(null);
//            }
//        }
//
//
//
//        PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getModelNaturalskill().removeAllElements();
//        if(petSkillsJpanel.skllNum == 7) {
//        	for (int i = 0; i < 5; ++i) {
//        		petSkillsJpanel.getLabPetskillsTS()[i].setIcon(null);
//        		petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(null);
//        	}
//        }
////        新增加5-9天生技能图标显示
//        if(configure7.getZhsjngs().equals("新")) {
//
//        if(petSkillsJpanel.skllNum == 5) {
//            for (int i = 0; i < 5; ++i) {
//                petSkillsJpanel.getLabPetskillsTS()[i].setIcon(null);
//                petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(null);
//            }
//        }
//
//            if(petSkillsJpanel.skllNum == 9) {
//                for (int i = 0; i < 5; ++i) {
//                    petSkillsJpanel.getLabPetskillsTS()[i].setIcon(null);
//                    petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(null);
//                }
//            }
//        }
//
////        新增加5-9天生技能图标显示
//
//
//
//
//        if (UserMessUntil.getChosePetMes().getSkill() != null && !UserMessUntil.getChosePetMes().getSkill().equals("")) {
//            final String[] petnaturalskill = UserMessUntil.getChosePetMes().getSkill().split("\\|");
//
//
//            for (int i = 0; i < petnaturalskill.length; ++i) {
//            	if(petSkillsJpanel.skllNum == 7) {
//                	final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//        			final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
//        			img.setImage(img.getImage().getScaledInstance(50, 50, 10));
//        			petSkillsJpanel.getLabPetskillsTS()[i].setIcon((Icon)img);
//        			petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(skill);
//            	}else {
//            		final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//            		PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getModelNaturalskill().add(i, skill.getSkillname());
//            	}
//
//
//            }
//
//
////        新增加5-9天生技能图标显示
//
//            if(configure7.getZhsjngs().equals("新")) {
//            for (int i = 0; i < petnaturalskill.length; ++i) {
//                if(petSkillsJpanel.skllNum == 5) {
//                    final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                    final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
//                    img.setImage(img.getImage().getScaledInstance(50, 50, 10));
//                    petSkillsJpanel.getLabPetskillsTS()[i].setIcon((Icon)img);
//                    petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(skill);
//                }else {
//                    final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                    PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getModelNaturalskill().add(i, skill.getSkillname());
//                }
//
//
//            }
//
//            for (int i = 0; i < petnaturalskill.length; ++i) {
//                if(petSkillsJpanel.skllNum == 9) {
//                    final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                    final ImageIcon img = new ImageIcon("inkImg/old/skill/wxs_" + petnaturalskill[i] + ".png");
//                    img.setImage(img.getImage().getScaledInstance(50, 50, 10));
//                    petSkillsJpanel.getLabPetskillsTS()[i].setIcon((Icon)img);
//                    petSkillsJpanel.getShowPetSkillsTS()[i].setSkill(skill);
//                }else {
//                    final Skill skill = (Skill)UserMessUntil.getSkillBean().getSkillMap().get(petnaturalskill[i]);
//                    PetSkillsJframe.getPetSkillsJframe().getPetSkillsJpanel().getModelNaturalskill().add(i, skill.getSkillname());
//                }
//
//
//            }
//
//            }
////        新增加5-9天生技能图标显示
//
//
//        }
//
//
//

    }
}
